home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / CHASSIS_ / MYHEADER.H < prev    next >
Text File  |  1992-05-17  |  8KB  |  204 lines

  1. /************************************************************************************/
  2. /*    MidRoad.h                                                                        */
  3. /*                                                                                    */
  4. /*    See also MyGlobals.c                                                            */
  5. /************************************************************************************/
  6.  
  7. /************************************************************************************/
  8. /*    The following headers are precompiled into module <MidRoadHeaders>,                */
  9. /*    and included automatically by the compiler:                                        */
  10. /*                                                                                    */
  11. /*        string.h                BDC.h                    Controls.h                    */
  12. /*        Desk.h                    Devices.h                Dialogs.h                    */
  13. /*        DiskInit.h                Errors.h                Events.h                    */
  14. /*        Files.h                    Fonts.h                    GestaltEqu.h                */
  15. /*        Lists.h                    Memory.h                Menus.h                        */
  16. /*        Notification.h            OSEvents.h                OSUtils.h                    */
  17. /*        Packages.h                PrintTraps.h            Quickdraw.h                    */
  18. /*        Resources.h                Scrap.h                    SegLoad.h                    */
  19. /*        Sound.h                    StandardFile.h            TextEdit.h                    */
  20. /*        Timer.h                    ToolUtils.h                Types.h                        */
  21. /*        Windows.h                pascal.h                asm.h                        */
  22. /*        LoMem.h                    THINK.h                                                */
  23. /*                                                                                    */
  24. /************************************************************************************/
  25.  
  26. /**************************                                                         */
  27. /*    SYMBOL DEFINITIONS    *                                                         */
  28. /**************************                                                         */
  29. #define     NIL                 0
  30. #define        windMax                16
  31. #define        windTEHMax            12
  32. #define        windCntlHMax        8
  33. #define        helpCount            17
  34.  
  35. #define        ProcMain            1
  36. #define        ProcHelp            2
  37. #define        ProcText            3
  38.  
  39. #define        AppleMenuID        128
  40. #define            AboutItem        1
  41. #define            HelpItem        2
  42. #define        FileMenuID        129
  43. #define            NewItem            1
  44. #define            OpenItem        2
  45. #define            SaveItem        4
  46. #define            SaveAsItem        5
  47. #define            PageSetupItem    7
  48. #define            PrintItem        8
  49. #define            CloseItem        10
  50. #define            QuitItem        12
  51. #define        EditMenuID        130
  52. #define            CutItem            1
  53. #define            CopyItem        2
  54. #define            PasteItem        3
  55. #define            ClearItem        4
  56. #define        ProgramMenuID    131
  57. #define            KudosItem        1
  58.                                                                                                                                                                               
  59. /**************************                                                         */
  60. /*    PROTOTYPES              *                                                         */
  61. /**************************                                                         */
  62. int         InitMac(void);
  63. int         ShutMac(void);
  64. int            MouseDownProc(void);
  65. int            KeyDownProc(void);
  66. int         SetUpMenus(void);
  67. int            MenuProc(long);
  68. int         ShowInfoDlog(int dlogNo);
  69. pascal void        DrawDefaultBorder(DialogPtr, short);
  70. pascal void        DrawUserIcon(DialogPtr, short);
  71. int            MainGetProc(void);
  72. int            MainDrawProc(void);
  73. int         WhichWindow(WindowPtr, int *);
  74. int            MainWindowProc(void);
  75. int            MainCloseProc(void);
  76. int            NextSubAndPosit(Point *);
  77. int            TextGetProc(void);
  78. int            TextDrawProc(void);
  79. int            TextWindowProc(void);
  80. int            TextResizeProc(void);
  81. int            TextCloseProc(void);
  82. int            HelpGetProc(void);
  83. int            HelpDrawProc(void);
  84. int            HelpWindowProc(void);
  85. int            HelpCloseProc(void);
  86. int         PlaceAlert(int);
  87. pascal Boolean    myActionProc(ControlHandle, short);
  88. pascal Boolean    myClikLoop(void);
  89. int            MenuUpdate(int);
  90. int            CursorSelect(WindowPtr, int, int);
  91. int            FileOpenProc(void);
  92. int         FileSaveProc (Boolean);
  93. long        ReadIntoTE(int, TEHandle);
  94. long        WriteFromTE(int, TEHandle);
  95. pascal void        myIdleProc(void);
  96. int            PrintWindowProc(int);
  97. int            FinderFilesProc(void);
  98. Boolean        ColorCheck(void);
  99.  
  100. /**************************                                                         */
  101. /*    EXTERNAL VARIABLES      *                                                         */
  102. /**************************                                                         */
  103. extern    int            MainRetCode;                /* main program return code            */
  104. extern    int            WorkRetCode;                /* work return code                    */
  105. extern    int            j,k,l,m,n;                    /* work variables                    */
  106. extern    long        worklong;                    /* work variable                    */
  107. extern    Rect        workRect;                    /* work variable                    */
  108. extern    int            workInt;                    /* work variable                    */
  109. extern    Handle        workHandle;                    /* work variable                    */
  110. extern    Point        workPoint;                    /* work variable                    */
  111. extern    char        workChar;                    /* work variable                    */
  112. extern    TEHandle    workTEHandle;                /* work variable                    */
  113. extern    ControlHandle    workControlHandle;        /* work variable                    */
  114. extern    Str255        workStr255;                    /* work variable                    */
  115. extern    Boolean        workBoolean;                /* work variable                    */
  116. extern    GrafPtr        workGrafPtr;                /* work variable                    */
  117.                                                                                        
  118. extern    EventRecord        myEvent;                /* from event loop                    */
  119. extern    int                myQuitFlag;                /* flag to get out of event loop    */
  120.  
  121. extern    WindowPtr        workWindowPtr;            /* pointer from FindWindow            */
  122. extern    int                myMouseWhere;            /* location (not Point) of mouse    */
  123.  
  124. extern    char            testChar;                /* character for boolean operations    */
  125.  
  126. extern    MenuInfo         **myMenuHandle[4];        /* handles for various menus        */
  127. extern    Str255            menuItemName;            /* name returned from menu select    */
  128. extern    int                mymenuID;                /* menu ID from MenuSelect            */
  129. extern    int                mymenuItem;                /* menu item number from MenuSelect    */
  130.  
  131. extern    DialogPtr        myDlogPtr;                /* pointer to active dialog            */
  132. extern    DialogTemplate    myDTmpl,**myDTmplH;        /* template for active dialog        */
  133.  
  134. extern    AlertTemplate    myATmpl,**myATmplH;        /* template for active Alert        */
  135.  
  136. extern    struct    wTblStruct                        /* space for some window info        */
  137.         {    
  138.             WindowPtr        windPtr;            /* pointer to window record            */
  139.             WindowRecord    windRec;            /* window record                    */
  140.             TEHandle        windTEH[windTEHMax];    /* handles for TE items            */
  141.             int                windTEHCount;            /* how many handles are in use    */
  142.             int                windTEHSub;                /* subscript for active TE item    */
  143.             ControlHandle    windCntlH[windCntlHMax];    /* handles to controls        */
  144.             int                windCntlHSub;            /* subscript for active control    */
  145.             int                windCntlHCount;            /* how many controls are in use    */
  146.             SFReply            windReply;            /* SF Reply associated with window    */
  147.             int                windPathRefNum;        /* Path reference number from open    */
  148.             Boolean            windTEChanged;        /* Data changed since previous save    */
  149.         }
  150.         windTbl[windMax];                        /* table of many of the above        */
  151. extern    int                windSub;                /* subscript for window table        */
  152.  
  153. extern    int                myResRefNum;            /* application res file ref num        */
  154. extern    int                initResRefNum;            /* res file ref num after inits        */
  155.  
  156. extern    Rect            myDragRect;                /* outer bounds for dragging        */
  157.  
  158. extern    Point            nextTextPosit;            /* Position of next text window        */
  159.  
  160. extern    Rect            destRect;                /* for calculations of TE areas        */
  161. extern    Rect            viewRect;                /* for calculations of TE areas        */
  162. extern    RgnHandle        workRegionH;            /* work handle for TE redraw        */
  163.  
  164. extern    WindowPtr        mouseWindPtr;            /* pointer to window with cursor    */
  165. extern    Point            locMouse;                /* local coords of mouse            */
  166. extern    Point            gMouse;                    /* global coords of mouse            */
  167. extern    int                mouseWindPart;            /* part code in window                */
  168.  
  169. extern    SFReply            workReply;                /* work area for std file reply        */
  170. extern    int                workRC;                    /* work area for open return code    */
  171. extern    int                workPathRefNum;            /* work area path ref num from open    */
  172.  
  173. extern    int                appMessage;                /* startup message from Finder        */
  174. extern    int                appCount;                /* number of docs from Finder        */
  175. extern    AppFile            appTheFile;                /* file information from Finder        */
  176. extern    long            appMenuLong;            /* menu longword for menu proc        */
  177. extern    int                appIndex;                /* index pointer for GetAppFiles    */
  178.  
  179. extern    THPrint            prRecHdl;                /* handle to print record            */
  180. extern    TPPrPort        prPortPtr;                /* pointer to print port            */
  181.  
  182. extern    Boolean            useColor;                /* should we use color windows, etc    */
  183.  
  184. extern    Handle            theSnd;                    /* handle to sound resource            */
  185. extern    OSErr            sndRC;                    /* return code from SndPlay            */
  186. extern    Ptr                theSndChan;                /* sound channel                    */
  187.  
  188. extern    ScrapStuff        *scrapPtr;                /* pointer to desk scrap            */
  189. extern    long            scrapOffset;            /* offset from beginning of scrap    */
  190.  
  191. extern    ListHandle        helpList;                /* handle for List Manager            */
  192. extern    Point            helpCell;                /* cell for List Manager            */
  193. extern    long            helpLong;                /* for help facility                */
  194. extern    Rect            helpRect;                /* for help facility                */
  195. extern    Handle            helpHandle;                /* work handle for help                */
  196. extern    int                helpPrev;                /* previously selected help item    */
  197.  
  198. extern    struct            versRec                    /* vers resource                    */
  199.         {
  200.         char    versChar[520];
  201.         }
  202.         **versRecHandle;
  203. extern    Str255            versLongStr;            /* long string from vers resource    */
  204.